﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EmailClient.DTO;
using System.Data;
using System.Data.SqlClient;

namespace EmailClient.DAO
{
    class ParametersDAO : ConnectDataBase
    {
        public static DataTable GetAllParameters()
        {
            string sql = "select * from Parameters";
            return ConnectDataBase.ExcuQuery(sql);
        }
        public static void InsertParameters(string pathFolder)
        {
            string sql = "insert into Parameters (WhereToSaveEmail) values ('" + pathFolder + "')";
            ConnectDataBase.ExcuNonQuery(sql);
        }
        public static void UpdateParameters(string newPathFolder)
        {
            string sql = "update Parameters set WhereToSaveEmail = '" + newPathFolder + "'";
            ConnectDataBase.ExcuNonQuery(sql);
        }
    }
}
